package com.xjj.myoa.config;

import com.xjj.myoa.interceptor.LoginCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class LoginCheckConfig implements WebMvcConfigurer {

    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration interceptor = registry.addInterceptor(new LoginCheckInterceptor());
        interceptor.addPathPatterns("/**");
        interceptor.excludePathPatterns("/login.html", "/login", "/**/*.js", "/imgs/*");
    }
}
